<%@ page contentType="text/html; charset=UTF-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>新增投保单</title>
<link type="text/css" href="css/custom-theme/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript" src="development-bundle/ui/i18n/jquery.ui.datepicker-zh-CN.js"></script>

<script type="text/javascript">
$(document).ready(function() {

    $(".myDateInput").datepicker({ dateFormat: 'yy-mm-dd' });

});
</script>

<style type="text/css">
<!--
.WARNING1 {color: #FF0000}
.STYLE1 {
	font-size: 12px
}

.STYLE3 {
	font-size: 12px;
	font-weight: bold;
}

.STYLE4 {
	color: #03515d;
	font-size: 12px;
}

-->
</style>

<script>
var highlightcolor = '#c1ebff';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var clickcolor = '#51b2f6';
function changeto() {
	source = event.srcElement;
	if (source.tagName == "TR" || source.tagName == "TABLE")
		return;
	while (source.tagName != "TD")
		source = source.parentElement;
	source = source.parentElement;
	cs = source.children;
	//alert(cs.length);
	if (cs[1].style.backgroundColor != highlightcolor && source.id != "nc"
			&& cs[1].style.backgroundColor != clickcolor)
		for (i = 0; i < cs.length; i++) {
			cs[i].style.backgroundColor = highlightcolor;
		}
}

function changeback() {
	if (event.fromElement.contains(event.toElement)
			|| source.contains(event.toElement) || source.id == "nc")
		return


if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}
</script>

<script type="text/javascript">

function submitForm() {
	document.forms["myform"].submit();
}

function deleteMultiple() {
	document.forms["form1"].submit();
}
</script>

		<script type="text/javascript">
// --列头全选框被单击---
function ChkAllClick(sonName, cbAllId) {
	var arrSon = document.getElementsByName(sonName);
	var cbAll = document.getElementById(cbAllId);
	var tempState = cbAll.checked;
	for (i = 0; i < arrSon.length; i++) {
		if (arrSon[i].checked != tempState)
			arrSon[i].click();
	}
}
// --子项复选框被单击---
function ChkSonClick(sonName, cbAllId) {
	var arrSon = document.getElementsByName(sonName);
	var cbAll = document.getElementById(cbAllId);
	for ( var i = 0; i < arrSon.length; i++) {
		if (!arrSon[i].checked) {
			cbAll.checked = false;
			return;
		}
	}
	cbAll.checked = true;
}
// --反选被单击---
function ChkOppClick(sonName) {
	var arrSon = document.getElementsByName(sonName);
	for (i = 0; i < arrSon.length; i++) {
		arrSon[i].click();
	}
}
</script>
</head>

<body style="font-size: 12px;">
<span style="font-weight: 900;">你当前的位置：</span>[投保管理]-[录入投保单]
<form id="form1" name="form1" method="post" action="application/newInsuranceApp"> 
<!-- <form id="form1" name="form1" method="post" action="application/applyUnderwrite">-->
  <h4>基本信息  </h4>
  <hr />
  <!-- 
  <p>投保单号：
    <label>
    <input type="text" name="insuranceApp.SAppNo" value="46465465464654"/>
    </label> 
  </p> -->
  <p>
    <span class="WARNING1">*</span>投保日期：
     <label>
     <input name="insuranceApp.DAppTm" type="text" class="myDateInput" />&nbsp; 
  </label>
  </p>
  <p><span class="WARNING1">*</span>保险起止期：
    <label>
    <input name="insuranceApp.DBgnTm" type="text" class="myDateInput"/>
    </label>
    &#8212;
    <label>
  <input name="insuranceApp.DEndTm"  type="text" class="myDateInput" />
  </label>
  <label>
  <input type="checkbox" name="checkbox" value="checkbox" />
  </label>
  即时生效</p>
  <p>承保机构：
    <label>
     <input type="hidden"  name="insuranceApp.department.SDeptNo"  value="${dept.SDeptNo}"/>
   	 <input type="text"   value="${dept.SDeptNo}  ${dept.SDeptName}" readonly="readonly" style="background-color: #CCC"/>
    </label>
    	产品：
  <label>
  	<input type="hidden" name="insuranceApp.product.SProductCde" value="${prod.SProductCde}"/>
    <input type="text" value="${prod.SProductCde}  ${prod.SProductName}" readonly="readonly" style="background-color: #CCC"/>
  </label>
  </p>
  <p><span class="WARNING1">*</span>录单员：
    <label>
     <select name="insuranceApp.entering.SEmpCde">
  		<s:iterator value="#request.emps" var="emp">
  			<s:if test="SMajor =='录单员'" >
	  			<option value="<s:property value="SEmpCde"/>">
	  			<s:property value="SEmpCde"/>&nbsp;<s:property value="#emp.dept.SDeptName"/>
	  			&nbsp;<s:property value="SEmpName"/>
	  			</option>
  			</s:if>  			
  		</s:iterator>
 	 </select>
    </label>
    <span class="WARNING1">*</span>录单日期：
  <label>
  	<input type="text" name="insuranceApp.DFillAppTm" class="myDateInput"/>
  </label>
  	<span class="WARNING1">*</span>业务员：
  <label>
  	 <select name="insuranceApp.businessMan.SEmpCde">
  		<s:iterator value="#request.emps" var="emp">
  			<s:if test="SMajor =='业务员'" >
  				<option value="<s:property value="SEmpCde"/>">
  				<s:property value="SEmpCde"/>&nbsp;<s:property value="#emp.dept.SDeptName"/>
  				&nbsp;<s:property value="SEmpName"/>
  				</option>
  			</s:if>
  		</s:iterator>
 	 </select>
  </label>
  </p>
  <h4>投保人信息</h4>
  <hr />
  <p><span class="WARNING1">*</span>投保人名称：
    <label>
      <input type="text" name="insuranceApp.applicant.SName" value=""/>
    </label>
性别：
<label>
  <select name="insuranceApp.applicant.SSex">
    <option value="男">男</option>
    <option value="女">女</option>
  </select>
</label>
<span class="WARNING1">*</span>投保人类型：
<label>
  <select name="insuranceApp.applicant.SType">
    <option>法人</option>
    <option>个人</option>
  </select>
</label>
  </p>
  <p><span class="WARNING1">*</span>证件类型：
    <label>
      <select name="insuranceApp.applicant.SCtcType">
        <option>身份证</option>
        <option>学生证</option>
        <option>军官证</option>
      </select>
    </label>
    <span class="WARNING1">*</span>证件号码：
    <label>
      <input type="text" name="insuranceApp.applicant.SCtcNum"/>
    </label>
    通讯地址：
    <input type="text" name="insuranceApp.applicant.SAddress" />
  </p>
  <p>
    邮编：
  <input type="text" name="insuranceApp.applicant.SZipCode" />
    联系电话：
  <input type="text" name="insuranceApp.applicant.SMobile" />
    email:
  <input type="text" name="insuranceApp.applicant.SEmail" />
  </p>
<h4>被保人信息</h4>
  <hr />
  <p><span class="WARNING1">*</span>被保人名称：
    <label>
      <input type="text" name="insuranceApp.insurant.SName" />
    </label>性别：
<label>
  <select name="insuranceApp.insurant.SSex">
    <option value="男">男</option>
    <option value="女">女</option>
  </select>
</label>
<span class="WARNING1"></span>投保人类型：
<label>
  <select name="insuranceApp.insurant.SType">
    <option value="法人">法人</option>
    <option value="个人">个人</option>
  </select>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>
  </p>
  <p><span class="WARNING1">*</span>证件类型：
    <label>
      <select name="insuranceApp.insurant.SCtcType">
        <option value="身份证">身份证</option>
        <option value="学生证" selected="selected">学生证</option>
        <option value="军官证">军官证</option>
      </select>
    </label>
    <span class="WARNING1">*</span>证件号码：
    <label>
      <input type="text" name="insuranceApp.insurant.SCtcNum" />
    </label>
    &nbsp;通讯地址：
    <input type="text" name="insuranceApp.insurant.SAddress" />
  </p>
  <p>邮编：
    <input type="text" name="insuranceApp.insurant.SZipCode" />
     联系电话：
    <input type="text" name="insuranceApp.insurant.SMobile" />
     email:&nbsp;
    <input type="text" name="insuranceApp.insurant.SEmail" />
  </p>
<h4>车辆信息</h4>
  <hr />
  <span class="WARNING1">*</span>车牌号码：
<label>
    <input type="text" name="insuranceApp.vehicle.SPlateNo" />
  &nbsp;</label>
<span class="WARNING1">*</span>发动机号
  <label>
    <input type="text" name="insuranceApp.vehicle.SEngNo" />
  &nbsp;</label>
  <span class="WARNING1">*</span>车架号
  <label>
    <input type="text" name="insuranceApp.vehicle.SFrmNo" />
  </label>
  <p>进口/国产：
    <label>
      <select name="select3">
        <option>进口</option>
        <option>国产</option>
      </select>
      &nbsp; </label>品牌
  <label>
    <input type="text" name="insuranceApp.vehicle.SBrand" />
    &nbsp;</label>车型：
  <label> </label>
  <label>
    <input type="text" name="insuranceApp.vehicle.SModel" />
  </label>
  </p>
  <p><span class="WARNING1">*</span>使用性质：
    <label>
      <input type="text" name="insuranceApp.vehicle.SUsage" />
      &nbsp;&nbsp;</label>
    <span class="WARNING1">*</span>车辆类型：
    <label>
      <input type="text" name="insuranceApp.vehicle.SType" />
    </label>
    座位数：
  <label>
    <input type="text" name="insuranceApp.vehicle.NSeatNum" />
  </label>
  </p>
  <p>新车购置价：
    <label>
      <input type="text" name="insuranceApp.vehicle.NNewPurchaseValue" />
    </label>
  是否外地车：
  <label>
    <select name="select5">
      <option>是</option>
      <option>否</option>
    </select>
  </label>行驶区域：
  <label>
    <select name="insuranceApp.vehicle.SRunArea">
      <option selected="selected" value="境内">境内</option>
      <option value="省内">省内</option>
      <option value="固定行驶路线">固定行驶路线</option>
      <option value="场内">场内</option>
    </select>
  </label>
  初登年月：
  <label>
    <input type="text" name="insuranceApp.vehicle.SFstRegYm" id="myDateInput"/>
  </label>
  </p>
<h4>驾驶员信息</h4>
<hr />
<p>驾驶员名称：
  <label>
    <input type="text" name="insuranceApp.vehicle.vhlDriver.SDrvName" />
  </label>
出生年月：
   <label>
     <input name="insuranceApp.vehicle.vhlDriver.SBirthday" type="text"  class="myDateInput"/>
   </label>
&nbsp;年龄：
   <input type="text" name="insuranceApp.vehicle.vhlDriver.SAge" />
岁 </p>
<p> 性别：
  <label>
    <select name="select2">
      <option>男</option>
      <option>女</option>
    </select>
  </label>
   驾龄：
  <label>
    <input type="text" name="insuranceApp.vehicle.vhlDriver.SDriverAge" />
    年</label>
  &nbsp;婚姻状况：
  <label>
    <select name="insuranceApp.vehicle.vhlDriver.SMariSts">
      <option value="已婚">已婚</option>
      <option value="未婚">未婚</option>
      <option value="离婚">离婚</option>
      <option value="不详">不详</option>
    </select>
  </label>
</p>
<p>驾驶证号：
  <label>
    <input type="text" name="insuranceApp.vehicle.vhlDriver.SDrvLns" />
  </label>
  &nbsp;职业类别：
  <label>
    <select name="insuranceApp.vehicle.vhlDriver.SMajor">
      <option value="行政公务员">行政公务员</option>
      <option value="商贸服务">商贸服务</option>
      <option value="产业工人">产业工人</option>
      <option value="科教院校">科教院校</option>
    </select>
  </label>
</p>
<h4>车主信息</h4>
<hr />
<p><span class="WARNING1">*</span>车主名称：
  <label>
    <input type="text" name="insuranceApp.vehicle.vhlOwner.SName" />
  </label>
  <span class="WARNING1"></span> <span class="WARNING1">*</span>证件类型：
  <label>
    <select name="insuranceApp.vehicle.vhlOwner.SCtcType">
      <option value="身份证">身份证</option>
      <option value="学生证">学生证</option>
      <option value="军官证">军官证</option>
    </select>
  </label>
  <span class="WARNING1">*</span>证件号码：
  <label>
    <input type="text" name="insuranceApp.vehicle.vhlOwner.SCtcNum"/>
  </label>
</p>
<p> 通讯地址：
  <input type="text" name="insuranceApp.vehicle.vhlOwner.SAddress"/>
  &nbsp;&nbsp; 邮编：
  <input type="text" name="insuranceApp.vehicle.vhlOwner.SZipCode"/>
  &nbsp;&nbsp;&nbsp; 联系电话：
  <input type="text" name="insuranceApp.ivehicle.vhlOwner.SPhone"/>
  <br />
</p>
<p> email:&nbsp;
  <input type="text" name="insuranceApp.vehicle.vhlOwner.SEmail"/>
</p>
<h4>险别信息</h4>
<hr />
<table width="100%" border="0" cellpadding="0" cellspacing="1"
									bgcolor="b5d6e6" onmouseover="changeto()"
									onmouseout="changeback()">
		  <tr>
		    <td width="10%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"><input type="checkbox" name="cvrgAll" id="cvrgAll"
																			title="全选" onclick="ChkAllClick('cvrgNoCheckbox','cvrgAll')" /></div></td>
		    <td width="11%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">序号</span></div></td>
		    <td width="16%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">险别代码</span></div></td>
		    <td width="34%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">险别名称</span></div></td>
		    <td width="29%" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">所属产品</span></div></td>
	      </tr>
		    <s:iterator value="#request.cvrgs" status="status" var="cvrg">
		      <tr>
		        <td height="20" bgcolor="#FFFFFF"><div align="center">
		          <input type="checkbox" name="cvrgNoCheckbox" value="<s:property value="SCvrgNo" />"
														onclick="ChkSonClick('cvrgNoCheckbox','cvrgAll')" />
		          </div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE1">
		          <div align="center">
		            <s:property value="#status.index+1" />
	              </div>
		          </div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">
		          <s:property value="SCvrgNo" />
		          </span></div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">
		            <s:property value="SCvrgNm" />
		            </span></div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE1">
		          <div align="center">
		            <s:property value="product.SProductName"/>
	              </div>
		          </div></td>
	          </tr>
	        </s:iterator>
</table>



<h4>浮动系数</h4>
<hr />
<s:if test="#request.prod.SProductCde == '030001'">
	<jsp:include page="coef_traffic.jsp" />
</s:if>
<s:elseif test="#request.prod.SProductCde == '033001'">
	<jsp:include page="coef_business.jsp" />
</s:elseif>
<h4>特别约定</h4>
<hr />
<table width="100%" border="0" cellpadding="0" cellspacing="1"
									bgcolor="b5d6e6" onmouseover="changeto()"
									onmouseout="changeback()">
		  <tr>
		    <td width="10%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"><input type="checkbox" name="specAll" id="specAll"
																			title="全选" onclick="ChkAllClick('specNoCheckbox','specAll')" /></div></td>
		    <td width="9%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">序号</span></div></td>
		    <td width="13%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">特约代码</span></div></td>
		    <td width="68%" height="22" background="tab/images/bg.gif"
											bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">特约内容</span></div></td>
	      </tr>
	      
		    <s:iterator value="#request.specs" status="status" var="spec">
		      <tr>
		        <td height="20" bgcolor="#FFFFFF"><div align="center">
		          <input type="checkbox" name="specNoCheckbox" value="<s:property value="SSpecCvtNo" />"
														onclick="ChkSonClick('specNoCheckbox','specAll')" />
		          </div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE1">
		          <div align="center">
		            <s:property value="#status.index+1" />
	              </div>
		          </div></td>
		        <td height="20" bgcolor="#FFFFFF"><div align="center"> <span class="STYLE1">
		          <s:property value="SSpecCvtNo" />
		          </span></div></td>
		        <td height="20" bgcolor="#FFFFFF">
		          <div align="center" style="text-align: left;"> <span class="STYLE1">
		            <s:property value="SSpecCvtCtd" />
		            </span></div></td>
	          </tr>
	        </s:iterator>
</table>
<p></p>
<div style=" text-align:center"><input type="submit" value="保存"/></div>
<p></p>

</form>
</body>
</html>
